home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr27 / p5math.zip / README.TXT < prev    next >
Text File  |  1995-03-20  |  3KB  |  73 lines

  1. DisableMath()
  2. -------------
  3.  
  4. Date of Release: 3/20/95
  5.  
  6. A function to disable Clipper's usage of the math coprocessor for
  7. Clipper 5.2, 5.01, 5.0, and Summer '87.  The following files,
  8. DISMATH.OBJ and DISMATH.ASM, have been placed in the public domain by
  9. Greg Martin of Horizon Real-Time Systems.  You may use, modify and
  10. distribute these files as you see fit provided the comments in
  11. DISMATH.ASM concerning original authorship are not modified.
  12.  
  13. The purpose of the DisableMath() function is to disable Clipper's
  14. usage of the math coprocessor when the program detects a faulty
  15. Pentium chip thus allowing the program to continue execution without
  16. the danger of an invalid computation being performed.  It will also
  17. disable Clipper's usage of any math coprocessor, not just the
  18. Pentium's, although I can think of no potential benefit for disabling
  19. the use of a perfectly good math coprocessor.
  20.  
  21. To use the DisableMath() function simply do a well-known computational
  22. test for a faulty Pentium and if the program determines the
  23. computation has erred then call DisableMath().  The following example
  24. should suffice:
  25.  
  26.    * Near beginning of program...
  27.    IF 4195835 - ((4195835 / 3145727) * 3145727) != 0
  28.       * Faulty Pentium found so disable math coprocessor usage
  29.       DisableMath()
  30.    ENDIF
  31.  
  32. DISMATH.OBJ can be linked into your executable like any other C/ASM
  33. file -- simply add it to your linker command line or link file.  If
  34. you are using Blinker to create real-mode applications, it can be
  35. dynamically overlaid.  It is also compatible with protected-mode
  36. linkers such as ExoSpace, Blinker, and Causeway.
  37.  
  38. As stated above, this function will work with versions of Clipper from
  39. Summer '87 to Clipper 5.2 (this was one section of Clipper that didn't
  40. change for many years), but it won't work with Clipper 5.3 or above
  41. because Clipper 5.3 began using a different math library.
  42.  
  43. Please note that this function DOES NOT disable the math coprocessor
  44. itself, but only Clipper's usage of it.  It does this by simply
  45. resetting a flag deep inside the bowels of Clipper which causes
  46. Clipper to use its own internal math library.
  47.  
  48. Also note that some third party libraries might do their own floating
  49. point math bypassing Clipper's math library.  In that case those third
  50. party routines might be affected by the Pentium bug.  Also note that
  51. if you have written your own C code and are linking in Microsoft's
  52. LLIBCE.LIB library (instead of the recommended LLIBCA.LIB) then your
  53. Clipper code will still use the math coprocessor and be susceptible to
  54. the Pentium bug.
  55.  
  56. You can use the enclosed TESTMATH.PRG sample code to verify the
  57. proper functioning of the DisableMath() function.
  58.  
  59. Finally, the author grants no warranties, express or implied, by
  60. statute or otherwise, regarding the fitness of this code for any
  61. purpose and in no event shall be liable for any special,
  62. consequential, or other damages.  Use at your own risk!  After all
  63. this is public domain software and if $1000 commercial software comes
  64. with such disclosures then surely this code qualifies too.
  65.  
  66. If you have any comments, please send them to my CompuServe address
  67. below.
  68.  
  69. Greg Martin
  70. Horizon Real-Time Systems, Inc.
  71. CompuServe ID 73707,3450
  72.  
  73.